/* Example of Using Unordered_Multiet */
#include <unordered_set>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

int unordmultiset1()
{
	// create and initialize, expand, and print unordered multiset
	unordered_multiset<int> coll = { 1, 2, 3, 5, 7, 11, 13, 17, 19, 77 };
	coll.insert({ -7, 17, 33, -11, 17, 19, 1, 13 });
	copy(coll.cbegin(), coll.cend(), ostream_iterator<int>(cout, " "));
	cout << endl;

	// remove all elements with specific value
	coll.erase(17);

	// remove one of the elements with specific value
	auto pos = coll.find(13);
	if (pos != coll.end())
	{
		coll.erase(pos);
	}
	for (auto i : coll)
	{
		cout << i << " ";
	}
	cout << endl;

	return 0;
}